<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<LINK href="images/css.css" type="text/css" rel="stylesheet">
</head>
<body>
<center>
<table class="tableline" id="Table1" cellspacing="1" cellpadding="0" width="80%" border="0">
    <tr>
     <td colspan="5" class="STYLE4" align="center" bgcolor="#ffffff" colspan="2" height="40">角色设置</td>
     </tr>
     <tr>
     <td colspan="5">
     <table width="100%" border="0" bgcolor="#ffffff" >
<html:form action="role.do?method=save" method="post">  
  <tr>
    <td width="20%" align="right">角色名：</td>
    <td><html:text property="name" value="${role.name }"/><font color="red">&nbsp;${error }</font></td>
  </tr>
  <tr>
    <td align="right">描述信息：</td>
    <td><html:text property="description" value="${role.description }"/><html:submit value="添加"/></td>
  </tr>
</html:form>
</table>
</td>
</tr>
    <tr align="center">
      <td width="15%" height="40" bgcolor="#ffffff">序号</td>
      <td bgcolor="#ffffff">角色名</td>
      <td width="30%" bgcolor="#ffffff">描述信息</td>
      <td colspan="2" bgcolor="#ffffff">操作</td>
    </tr>
    <c:if test="${!empty roles}">
      <c:forEach items="${roles}" var="role">
        <tr align="center">
          <td bgcolor="#ffffff">${role.id }</td>
          <td bgcolor="#ffffff">${role.name }</td>
          <td bgcolor="#ffffff">${role.description }</td>
          <td width="15%" bgcolor="#ffffff"><a href="role.do?method=toUpdate&id=${role.id }">修改</a></td>
          <td width="15%" bgcolor="#ffffff"><a href="role.do?method=delete&id=${role.id }">删除</a></td>
        </tr>
      </c:forEach>
    </c:if>
  </table>
</center>
</body>
</html>